import React, { Component } from 'react'
import { Text, View, Dimensions } from 'react-native'
import { WebView } from "react-native-webview"

const { width, height } = Dimensions.get('screen');
class Error extends Component {
    render() {
        return (
            <View>{this.props.name}</View>
        )
    }
}
export default class MyWebView extends Component {
    url = "https://baidu.com"
    render() {
        return (
            <WebView
                originWhitelist={["*"]}
                source={{ uri: this.url }}
                style={{ width: "100%", height: "100%" }}
                renderError={(errorName) => <Error name={errorName} />}
            />
        )
    }
}
